package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.domain.KingPurchasePriceDetailEntity;
import com.ly.heart.mapper.KingPurchasePriceDetailMapper;
import com.ly.heart.service.IKingPurchasePriceDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 金蝶-采购价目/折扣明细表Service业务层处理
 *
 * @author cxl
 * @date 2024-06-20
 */
@Service
public class KingPurchasePriceDetailServiceImpl extends ServiceImpl<KingPurchasePriceDetailMapper, KingPurchasePriceDetailEntity> implements IKingPurchasePriceDetailService {

    @Resource
    private KingPurchasePriceDetailMapper kingPurchasePriceDetailMapper;

    /**
     * 查询金蝶-采购价目/折扣明细表
     *
     * @param id 金蝶-采购价目/折扣明细表ID
     * @return 金蝶-采购价目/折扣明细表
     */
    @Override
    public KingPurchasePriceDetailEntity selectKingPurchasePriceDetailEntityById ( String id ) {
        return kingPurchasePriceDetailMapper.selectKingPurchasePriceDetailEntityById ( id );
    }

    /**
     * 查询金蝶-采购价目/折扣明细表列表
     *
     * @param kingPurchasePriceDetailEntity 金蝶-采购价目/折扣明细表
     * @return 金蝶-采购价目/折扣明细表
     */
    @Override
    public List<KingPurchasePriceDetailEntity> selectKingPurchasePriceDetailEntityList ( KingPurchasePriceDetailEntity kingPurchasePriceDetailEntity ) {
        return kingPurchasePriceDetailMapper.selectKingPurchasePriceDetailEntityList ( kingPurchasePriceDetailEntity );
    }

    /**
     * 新增金蝶-采购价目/折扣明细表
     *
     * @param kingPurchasePriceDetailEntity 金蝶-采购价目/折扣明细表
     * @return 结果
     */
    @Override
    public int insertKingPurchasePriceDetailEntity ( KingPurchasePriceDetailEntity kingPurchasePriceDetailEntity ) {
        kingPurchasePriceDetailEntity.setCreateTime ( DateUtils.getNowDate () );
        return kingPurchasePriceDetailMapper.insertKingPurchasePriceDetailEntity ( kingPurchasePriceDetailEntity );
    }

    /**
     * 修改金蝶-采购价目/折扣明细表
     *
     * @param kingPurchasePriceDetailEntity 金蝶-采购价目/折扣明细表
     * @return 结果
     */
    @Override
    public int updateKingPurchasePriceDetailEntity ( KingPurchasePriceDetailEntity kingPurchasePriceDetailEntity ) {
        return kingPurchasePriceDetailMapper.updateKingPurchasePriceDetailEntity ( kingPurchasePriceDetailEntity );
    }

    /**
     * 批量删除金蝶-采购价目/折扣明细表
     *
     * @param ids 需要删除的金蝶-采购价目/折扣明细表ID
     * @return 结果
     */
    @Override
    public int deleteKingPurchasePriceDetailEntityByIds ( String[] ids ) {
        return kingPurchasePriceDetailMapper.deleteKingPurchasePriceDetailEntityByIds ( ids );
    }

    /**
     * 删除金蝶-采购价目/折扣明细表信息
     *
     * @param id 金蝶-采购价目/折扣明细表ID
     * @return 结果
     */
    @Override
    public int deleteKingPurchasePriceDetailEntityById ( String id ) {
        return kingPurchasePriceDetailMapper.deleteKingPurchasePriceDetailEntityById ( id );
    }
}
